package aiaudio.storage.api;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 *
 * @author Nastya
 */
public class Utils {

    public static <T> List<T> convertToList(Iterator<T> iterator) {
        List<T> resultList = new ArrayList<T>();

        while (iterator.hasNext()) {
            T nextElement = iterator.next();
            resultList.add(nextElement);
        }
        return resultList;
    }
}
